package com.tian.arch.function.state

/**
 * 页面状态配置类
 */
class PageStateConfig(
    var loadingLayout: Int,
    var emptyLayout: Int,
    var errorLayout: Int,
    var onStatusChange: PageStateChangeListener? = null
) {
    /**
     * copy自身，得到一个新的对象，这样不会引起原有对象的改变
     *
     */
    fun copy(configBlock: PageStateConfig.() -> PageStateConfig): PageStateConfig {
        return configBlock(
            PageStateConfig(
                this.loadingLayout,
                this.emptyLayout,
                this.errorLayout,
                this.onStatusChange
            )
        )
    }
}
